home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 August / 1985-08.d64 / text print (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  72 lines

  1. 2400 poke198,0
  2. 2500 gosub2680
  3. 2510 fori=869to922:readd:pokei,d:next:rem data for ml bit map clear
  4. 2520 fori=923to956:readd:pokei,d:next:rem data for ml color fill
  5. 2530 bm=8192:poke53272,peek(53272)or8:rem put bit map at 8192
  6. 2540 sys869:rem clear bit map
  7. 2550 pixcol=2:scrcol=1:poke251,pixcol*16+scrcol
  8. 2560 sys923:rem set color matrix
  9. 2570 poke53265,peek(53265)or32:rem enter bit map mode
  10. 2580 rem hi-res plot
  11. 2590 fory=60to132:x=40
  12. 2600 gosub2920
  13. 2610 nexty
  14. 2620 forx=110to210:y=28
  15. 2630 gosub2920
  16. 2640 nextx
  17. 2650 forx=96to182:y=x
  18. 2660 gosub2920
  19. 2670 nextx:goto2740
  20. 2680 fori=828to868:readd:pokei,d:next:rem data for ml character rom copy
  21. 2690 poke56334,peek(56334)and254:rem turn off interrupts
  22. 2700 poke1,peek(1)and251:rem switch in character rom
  23. 2710 sys828:rem copy 128 characters to ram starting at 50176
  24. 2720 poke1,peek(1)or4:rem switch out character rom
  25. 2730 poke56334,peek(56334)or1:return:rem enable interrupts
  26. 2740 rem print text
  27. 2750 tx=24:ty=68:tcol=5:d=320:text$="vertical"
  28. 2760 gosub2960
  29. 2770 tx=120:ty=16:tcol=0:d=8:text$="horizontal"
  30. 2780 gosub2960
  31. 2790 tx=120:ty=104:tcol=4:d=328:text$="diagonal"
  32. 2800 gosub2960
  33. 2810 tx=160:ty=64:tcol=2:d=8:text$="characters, too:"
  34. 2820 gosub2960
  35. 2830 tx=160:ty=80:tcol=6:d=8:text$="[223] [182] [184] [183] [172] [176] [171] [177]"
  36. 2840 gosub2960
  37. 2850 ty=104:tcol=2:text$="[209] [218] [216] [193] [211] [214] [213] [215]"
  38. 2860 gosub2960
  39. 2870 geta$:ifa$=""then2870:rem press any key to return to basic
  40. 2880 poke53265,peek(53265)and223:rem exit from bit map mode
  41. 2890 poke53272,21:rem restore normal video
  42. 2900 printchr$(147)chr$(5)
  43. 2910 end
  44. 2920 rem hi-res plot subroutine
  45. 2930 row=int(y/8):char=int(x/8):line=yand7:bit=7-(xand7)
  46. 2940 byte=bm+row*320+char*8+line:pokebyte,peek(byte)or2^bit
  47. 2950 return
  48. 2960 rem text print subroutine
  49. 2970 bm=8192:scrcol = 1
  50. 2980 row=int(ty/8):char=int(tx/8)
  51. 2990 byte=bm+row*320+char*8
  52. 3000 fori=1tolen(text$)
  53. 3010 poke1024+(byte-bm)/8,tcol*16+scrcol
  54. 3020 sv=asc(mid$(text$,i,1)):rem get ascii
  55. 3030 ifsv<64then3060
  56. 3040 ifsv<192thensv=sv-64:goto3060
  57. 3050 sv=sv-128
  58. 3060 ca=50176+sv*8
  59. 3070 forj=0to7
  60. 3080 pokebyte+j,peek(ca+j)
  61. 3090 nextj
  62. 3100 byte=byte+d
  63. 3110 nexti
  64. 3120 return
  65. 3130 data234,72,138,72,152,72,160,0,185,0,208,153,0,196,185,0,209,153,0,197,185
  66. 3140 data0,210,153,0,198,185,0,211,153,0,199,200,208,229,104,168,104,170,104,96
  67. 3150 data234,72,138,72,152,72,162,32,169,0,133,251,138,133,252,160,0,169,0
  68. 3160 data145,251,200,208,251,232,224,63,208,239,169,0,133,251,169,63,133,252
  69. 3170 data160,0,169,0,145,251,200,192,64,208,249,104,168,104,170,104,96
  70. 3180 data234,72,138,72,152,72,160,0,173,251,0,153,0,4,153,250,4,153,244,5,153
  71. 3190 data238,6,200,192,250,208,239,104,168,104,170,104,96
  72.